# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=libetpan
pkgver=1.8
pkgrel=1
pkgdesc="A portable middleware for email access"
arch=('i686' 'x86_64')
url="http://www.etpan.org/libetpan.html"
license=("custom:etpan")
depends=('libgcrypt' 'gnutls' 'libsasl' 'zlib')
makedepends=('expat')
source=($pkgname-$pkgver.tar.gz::https://github.com/dinhviethoa/${pkgname}/archive/${pkgver}.tar.gz)
sha256sums=('4e67a7b4abadcf3cc16fa16e1621a68e54d489dadfd9a7d1f960c172e953b6eb')

prepare() {
  cd ${pkgname}-${pkgver}
  libtoolize --force --copy
  aclocal -I m4
  autoheader
  autoconf
  automake --add-missing --foreign --force --copy
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr \
    --disable-static \
    --disable-db \
    --with-openssl=no \
    --with-gnutls=yes
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check
  cd tests
  make imap-sample
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  install -Dm644 COPYRIGHT ${pkgdir}/usr/share/licenses/$pkgname/license.txt
}
